//Divers includes
#include "MLError.h"
#include "MLExeption.h"

//Reader includes
#include "MLReader.h"
#include "MLAviReader.h"
#include "MLMkvReader.h"

//Qt includes
#include <QObject>
#include <QString>
#include <QStringList>


MLReader::MLReader(QObject *parent) : QObject(parent)
{
    _extensionList  << EXTENSION_AVI
                    << EXTENSION_MKV
                    << EXTENSION_MP3
                    << EXTENSION_WMV
                    << EXTENSION_MLPL
                    << EXTENSION_XSPF;
}

bool MLReader::read(const QString &fileName)
{
    QString ext = fileName.split(".").back();

    if(ext == EXTENSION_AVI)
    {
        MLAviReader reader;
        return reader.read(fileName);
    }
    else
    {
        if(ext == EXTENSION_MKV)
        {
            MLMkvReader reader;
            //return reader.read(fileName);

        }
    }

    //MLExeption *exeption = new MLExeption(INVALID_EXTENSION,this);
    //throw(exeption);

    return false;
}
